#include <bits/stdc++.h>
using namespace std;
int x[100001], y[100001];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  sort(x + 1, x + n + 1);
  sort(y + 1, y + n + 1);
  int midx = x[n / 2 + 1], midy = y[n / 2 + 1];
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += abs(x[i] - midx) + abs(y[i] - midy);
  }
  cout << ans << endl;
  return 0;
}